//
//  YCNXViewController.m
//  YaDiuDiu
//
//  Created by 欧洪飞 on 2017/9/1.
//  Copyright © 2017年 jy. All rights reserved.
//

#import "YCNXViewController.h"
#import "UITextField+JKInputLimit.h"
#import "YCJGViewController.h"
@interface YCNXViewController ()
@property (weak, nonatomic) IBOutlet UITextField *textName;
@property (weak, nonatomic) IBOutlet UITextField *textPhone;
@property (weak, nonatomic) IBOutlet UITextField *textCard;
@property (weak, nonatomic) IBOutlet UITextField *textSchool;
@property (weak, nonatomic) IBOutlet UITextField *textZY;
@property (weak, nonatomic) IBOutlet UIButton *btnZZ;

@property (weak, nonatomic) IBOutlet UIButton *btnLiZhi;

@property (nonatomic,copy)NSString *state;

@end

@implementation YCNXViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _textName.jk_maxLength = 8;
    _textPhone.jk_maxLength = 11;
    _textCard.jk_maxLength = 18;
    _textSchool.jk_maxLength = 100;
    _textZY.jk_maxLength = 100;
    
    [self showNav:@"预测年薪"];
    [self loadUI];
    _state = @"在职";
    
}

- (void)loadUI{
    _btnLiZhi.layer.borderWidth = 1.0;
    _btnLiZhi.layer.borderColor = COLOR_RGB(242, 242, 242, 1).CGColor;
    
}

- (IBAction)clickZZ:(id)sender {
    _btnZZ.backgroundColor = [UIColor redColor];
    [_btnZZ setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    _btnLiZhi.backgroundColor = [UIColor whiteColor];
    [_btnLiZhi setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    _state = @"在职";
}

- (IBAction)clickLZ:(id)sender {
    _btnZZ.backgroundColor = [UIColor whiteColor];
    [_btnZZ setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    _btnLiZhi.backgroundColor = [UIColor redColor];
    [_btnLiZhi setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    _state = @"离职";
}

- (IBAction)clickyc:(id)sender {
    if (_textName.text.length == 0) {

        [LICGToast showWithText:@"姓名不能为空"];
    }else if ([self validateMobile:_textPhone.text] == 0){

        [LICGToast showWithText:@"手机号格式不正确"];
        
    }else if ([self checkIdentityCardNo:_textCard.text] == 0){
        
        [LICGToast showWithText:@"身份证号格式不正确"];
        
    }else if (_textSchool.text.length == 0){

        [LICGToast showWithText:@"学校不能为空"];
    }else if (_textZY.text.length == 0){
        
        [LICGToast showWithText:@"岗位不能为空"];
    }else{
        YCJGViewController *ycjg = [[YCJGViewController alloc] init];
        ycjg.name = _textName.text;
        ycjg.phone = _textPhone.text;
        [self.navigationController pushViewController:ycjg animated:YES];
    }
    
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [[UIApplication sharedApplication].keyWindow endEditing:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
